#include "DoubleLinkedList.h"

template <typename DT>
typename DoubleLinkedList<DT>::iterator find(DoubleLinkedList<DT>& _list, const DT& _val)
{
  typename DoubleLinkedList<DT>::iterator itr = _list.begin();
  while(itr != _list.end())
    {
      if(*itr == _val)
	return itr;
      else
	itr++;
    }
  std::cout << "NotFound!" << std::endl;
  return itr;
};

int main(int argc, char* argv[])
{
  DoubleLinkedList<int> L;
  L.push_back(1);
  L.push_back(2);
  L.push_back(3);
  L.push_back(4);
  L.push_back(5);
  L.printlist();
  DoubleLinkedList<int>::iterator iter;
  iter = find(L, 3);
  L.erase(iter);
  L.printlist();
  iter = find(L, 3);
  return 0;
}
